Safety mechanism for loops (Crystal syntax)

There is a safety mechanism to prevent report processing from hanging due to an infinite loop. Any one evaluation of a formula can have at most 30,000 loop condition evaluations per formula evaluation. This will be explained by the example below.

For example:

Local NumberVar i := 1;
While i <= 100000 Do
(
   If i > {movie.STARS} Then
      Exit While;
   i := i + 1
);
20

If {movie.STARS} is greater than 30,000 then the loop condition (i <= 100000) will be evaluated more than the maximum number of times and an error message is displayed. Otherwise the loop is OK.

Note:    The safety mechanism applies on a per formula base, not for each individual loop. For example:

Local NumberVar i := 1;
For i := 1 To 10000 Do
(
   Sin (i);
);
While i <= 25000 Do
(
   i := i + 1;
)

The above formula also triggers the safety mechanism since the 30,000 refers to the total number of loop condition evaluations in the formula and this formula will have 10001 + 25001 such evaluations.



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com